﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace black_screen_mode_server.DataCommunication
{
    public class HeartRequestData:IPacketData
    {
        public int clientId { get; set; }

        //构造函数
        public HeartRequestData()
        {
        }
        public void JsonToPacket(string jsonData)
        {
            var obj = Newtonsoft.Json.JsonConvert.DeserializeObject<HeartRequestData>(jsonData);
            this.clientId = obj.clientId;
        }

        public string PacketToJson()
        {
            //对象转json
            return Newtonsoft.Json.JsonConvert.SerializeObject(this);
        }
    }
}
